import { getStream } from '../Core/connect'
import { Vector3 } from '../Math/Vector3'
import { Object3D } from './Object3D'

export class Circle extends Object3D {
    readonly type: string
    radius: number
    constructor(name: string) {
        super({name: name, type: 'Circle'})
        this.type = 'Circle'
        this.radius = 10
    }

    setCircleRadius(radius: number) {
        const stream = getStream()
        this.radius = radius
        const str = {circleFunction: 'setCircleRadius', ids: `${this.uuid}`, radius: radius}
        stream.emitUIInteraction(str)
    }

    setCircleMaterial(color: Vector3, alpha: number) {
        const stream = getStream()
        const str = {circleFunction: 'setCircleMaterial', ids: `${this.uuid}`, color: color, alpha: alpha}
        stream.emitUIInteraction(str)
    }
}